package com.igroupes.ovineherd.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.igroupes.ovineherd.handler.BooleanTypeHandler;
import com.igroupes.ovineherd.handler.ListLongToStringHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@TableName(value = "data_model_version",autoResultMap = true)
public class DataModelVersionEntity extends BaseEntity {

    public static final Integer EDIT = 1; //编辑
    public static final Integer PUBLISH = 2; //发布
    public static final Integer RECORD = 3; //历史


    public static final Integer TOPPID = 0;
    @TableId(type = IdType.AUTO)
    private Long id;
    private Long pId;
    private String name; //版本名称
//    @TableField(value = "tables", typeHandler = ListLongToStringHandler.class)
//    private List<Long> tables;
//    @TableField(value = "relations", typeHandler = ListLongToStringHandler.class)
//    private List<Long> relations;
    @TableField(value = "has_edit", typeHandler = BooleanTypeHandler.class)
    private Boolean hasEdit; //是否编辑过
    private Integer currentVersion; //发布状态 1：编辑状态 2：发布状态 3：历史版本
}
